package com.njcs.test;

public class StringTest1 {
	public static void main(String[] args) {
		String a = "abc";
		String d = "abc";
		System.out.println(a == d);
		String b = a;
		b = b + "d";
		System.out.println(a + "====" + b);
		System.out.println(a == b);

		String r = "abc";
		func(r);
		System.out.println(r);

		String s1 = new String("123");
		String s2 = new String("123");
		System.out.println(s1 == s2);
	}

	/**
	 * 每当线程调用一个Java方法时, 虚拟机都会在该线程的Java栈中压入一个新帧, 
	 * 它使用这个帧来存储参数、局部变量、中间运算结果
	 */
	static void func(String s) {
		s += "tail";
	}
}
